package com.intellif.mozping.util;

import java.util.Properties;


public class KafkaHandler{
	private final LogProducer<String, String> logProducer;
	private static KafkaHandler handler;

	private KafkaHandler(Properties properties) {
		logProducer = new LogProducer<String, String>(properties);
	}

	public static KafkaHandler getInstance(Properties properties) {
		if (handler == null) {
			handler = new KafkaHandler(properties);
		}
		return handler;
	}

	public void handle(String topicName, String json) {
		// 发往kafka
		logProducer.send(topicName, json);
	}
}